const baseConfig = {
  state: {
    site_name: '',
    logo:'',
  },

  mutations: {
    SET_CONFIG: (state, { site_name, logo }) => {
      state.site_name = site_name
      state.logo = logo
    },
  },

  actions: {
    getConfig ({ commit }) {
      return new Promise((resolve, reject) => {
        this._vm.$api.config().then(response => {
          commit('SET_CONFIG', response)
          resolve()
        }).catch(error => {
          reject(error)
        })
      })
    },
  }
}

export default baseConfig
